package org.patterns.behavior.chainofresponsibility;


public class Client {
    public static void main(String[] args) {
        Approver zhangwj = new Director("张无忌");
        Approver yangguo = new VicePresident("杨过");
        Approver guojing = new President("郭靖");
        Approver meeting = new Congress("董事会");

        //创建职责链
        zhangwj.setSuccessor(yangguo);
        yangguo.setSuccessor(guojing);
        guojing.setSuccessor(meeting);

        //创建采购单
        PurchaseRequest pr1 = new PurchaseRequest(45000, 10001, "购买倚天剑");
        zhangwj.processRequest(pr1);

        PurchaseRequest pr2 = new PurchaseRequest(60000, 10002, "购买屠龙刀");
        zhangwj.processRequest(pr2);

        PurchaseRequest pr3 = new PurchaseRequest(160000, 10003, "购买《九阳真经》");
        zhangwj.processRequest(pr3);

        PurchaseRequest pr4 = new PurchaseRequest(800000, 10004, "购买桃花岛");
        zhangwj.processRequest(pr4);
    }
} 
